home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
logbatch
/
retain
/
RETAIN.DOC
next >
Wrap
Text File
|
1993-03-20
|
3KB
|
70 lines
RETAIN ver 1.0
(c)Copyright 1993, Chris Lowe
The problem...
I was in the process of installing a 100+ user version of Netware 386 when a
slight problem cropped up. As you know, you can MAP a fake root drive to the
users home directory (a very useful function). The command is usually in the
system login script and the syntax is probably something like this..
MAP ROOT DRIVE:=SERVER_NAME/VOLUME_NAME:USERS/%LOGIN_NAME
While this is a really trick idea, it presented me with a dilemma. Our system
is connected to a VAX used for terminal emulation. The login names on the VAX
are constructed using first initial, last name. My login would be CLOWE. The
first initial, last name ID convention is a good idea as it eliminates most
duplicate login names on Novell. HOWEVER... . What happens when the Novell
users login ID is more than 8 characters long, for example RCHRISTENSEN.
Novell creates the users home directory as RCHRISTEN and the MAP ROOT command
SERVER_NAME/VOLUME_NAME:USERS/RCHRISTENSEN fails because it can't find a
directory name longer than 8 characters (unless you hard code the name as
RCHISTEN.SEN and manually create the directory that way).
The solution...
What RETAIN does is shorten any DOS environment variable to the left or
right, a specified number of characters. I use it in the following way. In
the system login script are the following commands.
DOS SET NETNAME=%LOGIN_NAME
#RETAIN NETNAME L 8
In this example the first command puts a variable called NETNAME into the
environment table of the PC and sets it to a value of RCHRISTENSEN. The next
command changes the NETNAME variable to the left 8 characters, RCHRISTEN.
The last thing at the end of the system script (I don't use user scripts) is
the command EXIT "NEXTSTEP". In addition to numerous other things, the
nextstep batch file has this command, "MAP ROOT H:CH_1/VOL1:USERS/%NETNAME%".
This works just fine to properly set the users home directory.
RETAIN can be used to shorten variables to the left OR right OR a combination
of the two to get something out of the middle of a variable. The syntax for
using RETAIN is
RETAIN [VAR_NAME] [L or R] [# of characters]
DISCLAIMER
(or "covering my butt")
I make absolutely NO claims about RETAIN. Use it at your own risk. I am not
responsible for anything it may or may not do.
You may not charge for the use of RETAIN in any way. RETAIN is not public
domain and I retain all rights. You may use RETAIN free of charge and
distribute it freely provided the program and documentation accompany each
other.
Although there is no charge for RETAIN, if you find the program useful, a
contribution of $5.00 would be greatly appreciated. Comments and suggestions
are always welcome.
Chris Lowe
P.O. Box 411
Boise, ID 83711
Voice: (208) 336-7337
Compuserve: 73627,1745